<template>
  <div>用户信息 ID={{ $route.params.id }}</div>
</template>

<script>
export default {
  name: "UserProfile",
  beforeRouteEnter(to, from, next) {
    console.log("准备进入");
    next();
  },
  beforeRouteLeave(to, from, next) {
    console.log("准备离开");
    next();
  },
  methods: {
    getdata: function () {
      this.axios({
        method: "get",
        url: "http://localhost:8080/data.json",
      })
        .then(function (repos) {
          console.log(repos);
        })
        .catch(function (repos) {
           console.log(repos);
        });
    },
  },
};
</script>

<style>
</style>